﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Entity;

namespace BUL
{
    public class UserBul
    {
        readonly UserDal dal=new UserDal();
        public bool User_Check_Login(string username, string password)
        {
            return dal.User_Check_Login(username, password);
        }
        public List<User> User_GetById(string Id)
        {

            return dal.User_GetById(Id);
        }
        public List<User> User_GetByTop(string Top, string Where, string Order)
        {

            return dal.User_GetByTop(Top, Where, Order);
        }
        public List<User> User_GetByAll()
        {

            return dal.User_GetByAll();
        }
        public List<User> User_Validate(string UserName, string Password)
        {
            List<User> list = new List<User>();
            list = dal.User_GetByAll();
            return list.FindAll(obj => obj.Username == UserName && obj.Password == Password);
        }
        //public bool User_ChangePass(string UserName, string NewPassword)
        //{
        //    return dal.User_ChangePass(UserName, NewPassword);
        //}
        public List<User> User_Paging(string CurentPage, string PageSize)
        {

            return dal.User_Paging(CurentPage, PageSize);
        }

        public bool User_Insert(User data)
        {

            return dal.User_Insert(data);
        }

        public bool User_Update(User data)
        {

            return dal.User_Update(data);
        }

        public bool User_Delete(string Id)
        {

            return dal.User_Delete(Id);
        }

    }
}
